
using Microsoft.VisualStudio.Modeling.Diagrams;
using System.Drawing;
using Microsoft.VisualStudio.Modeling;
using DslFactory.Utilities.DteCodeModel;
using EnvDTE;

namespace Dslfactory.wcfLanguage
{
 public partial class HostingShape
 {
  /// <summary>
  /// Represented interface
  /// </summary>
  public Hosting Hosting
  {
   get
   {
    return ModelElement as Hosting;
   }
  }

  /// <summary>
  /// When double-clicking on a shape, we get to the type
  /// </summary>
  /// <param name="e"></param>
  public override void OnDoubleClick(DiagramPointEventArgs e)
  {
   KnownCodeTypes knownCodeTypes = KnownCodeTypes.FromStore(Store);
   if (knownCodeTypes == null)
    return;
   CodeType codeType = knownCodeTypes.GetFullNamedType(Hosting.FullName);
    if (codeType == null)
     return;

    IncrementalGenerator.TryToShow(codeType as CodeElement);
  }
 }
}
